<template>
  <div class="hm-item">
    <div class="hm-item-top">
      <div class="right">
        <img :src="item.avatar" alt="" />
      </div>
      <div class="left">
        <div class="title">{{ item.stem }}</div>
        <div class="bottom">
          <div class="author">{{ item.creator }} &nbsp;</div>
          <div>&nbsp;|&nbsp;</div>
          <div class="time">&nbsp;{{ item.createdAt }}</div>
        </div>
      </div>
    </div>
    <div class="center" v-html="item.content"></div>
    <div class="footer">
      <span>点赞 {{ item.likeCount }} | 浏览 {{ item.views }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "HmItem",
  props: {
    item: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style lang="less">
.hm-item {
  padding: 0 10px;
  .hm-item-top {
    display: flex;
    .right img {
      width: 25px;
      margin-top: 10px;
    }
    .left {
      margin-left: 10px;
      .bottom {
        display: flex;
        font-size: 14px;
        color: #a8a8a8;
        margin-top: 2px;
        .title {
          line-height: 20px;
        }
        .time {
          text-align: center;
          line-height: 20px;
        }
      }
    }
  }
  .center {
    margin-top: 10px;
    display: flex;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    // p {
    //   font-size: 16px;
    //   line-height: 20px;
    //   overflow: hidden;
    //   text-overflow: ellipsis;
    //   display: -webkit-box;
    //   -webkit-line-clamp: 2;
    //   -webkit-box-orient: vertical;
    // }
  }
}
</style>
